import request from '@/utils/request'
const baseUrl = '/cz-rentbox/api/v1/releaseSales' //租箱服务-- 发布售箱
// import { getReleaseSalesInfo } from '@/api/boxDeal/boxSeel'
/*
# 发布售箱:售箱公司查询自己发布的分页列表
# POST {{baseUrl}}/releaseSales/saleBoxSelectSelfPage
# 过滤条件：累计量区间:beginTotalRentQty endTotalRentQty  创建时间时间区间:beginCreateDate endCreateDate
# 提箱城市Id:carryCityId  箱型: boxType  箱况:boxCondition
# 发布状态:status 5-出租中 10-仓库中 15-待发布
*/
export const saleBoxSelectSelfPage = (data: any) => {
return request({
url: baseUrl+'/saleBoxSelectSelfPage',
method: 'post',
data: data
// data:{
//     "carryCityId":1,
//     "pageNum": 1,
//     "pageSize": 10
// }
})
}


/*
# 发布售箱:售箱公司查询买箱公司发布的分页列表(出租中)
# POST {{baseUrl}}/releaseSales/saleBoxSelectWantBuyPage
# 过滤条件：累计量区间:beginTotalRentQty endTotalRentQty 箱型:boxType 5 - 40HQ   10 - 40GP  15 - 20HQ   20 - 20GP 
# 箱况:boxCondition 5-全新   10-次新  15-适货 20-混提(次新或者适货)
# 提箱城市Id:carryCityId
*/
export const saleBoxSelectWantBuyPage = (data: any) => {
return request({
url: baseUrl+'/saleBoxSelectWantBuyPage',
method: 'post',
data: data
// data:{
//     "carryCityId":1,
//     "pageNum": 1,
//     "pageSize": 10
// }
})
}

// # 发布售箱:获取详情
// ReleaseSaleBean 
export const getSaleBoxSelectDetail = (data: any) => {
  return request({
  url: baseUrl+'/'+data,
  method: 'GET'
  // data:{
  //     "carryCityId":1,
  //     "pageNum": 1,
  //     "pageSize": 10
  // }
  })
  }

/*
# 发布售箱:求购箱公司查询自己发布的分页列表
# POST {{baseUrl}}/releaseSales/wantBuySelectSelfPage
# 过滤条件：累计量区间:beginTotalRentQty endTotalRentQty  创建时间时间区间:beginCreateDate endCreateDate
# 提箱城市Id:carryCityId  箱型: boxType  箱况:boxCondition
# 发布状态:status 5-出租中 10-仓库中 15-待发布
*/
export const wantBuySelectSelfPage = (data: any) => {
return request({
url: baseUrl+'/wantBuySelectSelfPage',
method: 'POST',
data: data
// data:{
//     "carryCityId":1,
//     "pageNum": 1,
//     "pageSize": 10
// }
})
}

/*
# 发布售箱:求购箱公司查询售箱公司发布的分页列表(出租中)
# POST {{baseUrl}}/releaseSales/wantBuySelectSaleBoxPage
# 过滤条件：累计量区间:beginTotalRentQty endTotalRentQty 箱型:boxType 5 - 40HQ   10 - 40GP  15 - 20HQ   20 - 20GP 
# 箱况:boxCondition 5-全新   10-次新  15-适货 20-混提(次新或者适货)
# 提箱城市Id:carryCityId
*/
export const wantBuySelectSaleBoxPage = (data: any) => {
return request({
url: baseUrl+'/wantBuySelectSaleBoxPage',
method: 'post',
data: data
// data:{
//     "carryCityId":1,
//     "pageNum": 1,
//     "pageSize": 10
// }
})
}

/*
# 发布售箱:获取详情
# GET {{baseUrl}}/releaseSales/{id}  # 售箱Id: Long id;
*/
export const getReleaseSalesInfo = (id: any) => {
return request({
  url: baseUrl+'/'+ id,
    method: 'GET'
  })
}

/*

### 发布售箱:售箱公司保存待发布(编辑增加id 传参)  售箱Id: Long id;
*/
export const saleBoxTobeReleased = (data: any) => {
return request({
url: baseUrl+'/saleBoxTobeReleased',
method: 'post',
data: data
// data:{
//     "carryCityId": 1,
//     "carryCityName": "郑州",
//     "carryCountryId": 1,
//     "carryCountryName": "中国",
//     "payCurrency":"USD,CNY",
//     "invoiceType":"5,15,20",
//     "productionDateStart":"2024-04-17T10:44:57",
//     "productionDateEnd":"2024-06-17T10:44:57",
//     "groundingMethod":5, // 上架方式 （已取消）
//     "remark": "备注",
//     "releaseSalePriceList":[{
//         "boxType":5,"boxCondition":5,"totalWeight":32580,
//         "inventory":25, "unitPrice":13500,"currency":"CNY"
//     }],
//     "mainFileList": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]"
// }
})
}

// ### 发布售箱:售箱公司发布放入仓库
export const saleBoxInWarehouse = (data: any) => {
return request({
  url: baseUrl+'/saleBoxInWarehouse',
  method: 'POST',
    data: data
  })
}


// {
//   "carryCityId": 1,
//   "carryCityName": "郑州",
//   "carryCountryId": 1,
//   "carryCountryName": "中国",
//   "payCurrency":"USD,CNY",
//   "invoiceType":"5,15,20",
//   "productionDateStart":"2024-04-17T10:44:57",
//   "productionDateEnd":"2024-06-17T10:44:57",
//   "groundingMethod":5,
//   "remark": "备注",
//   "releaseSalePriceList":[{
//       "boxType":5,"boxCondition":5,"totalWeight":32580,
//       "inventory":25, "unitPrice":13500,"currency":"CNY"
//   }],
//   "mainFileList": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]"
// }



/*
### 发布售箱:买箱公司保存待发布(编辑增加id 传参)  售箱Id: Long id;
*/
export const wangBuyTobeReleased = (data: any) => {
return request({
url: baseUrl+'/wangBuyTobeReleased',
method: 'post',
data: data
// data:{
//     "carryCityId": 1,"carryCityName": "郑州","carryCountryId": 1,"carryCountryName": "中国",
//     "payCurrency":"USD,CNY",
//     "invoiceType":"5,15,20",
//     "planPickupDate":"2024-04-17T10:44:57",
//     "groundingMethod":5,
//     "remark": "备注",
//     "releaseSalePriceList":[{
//         "boxType":5,"boxCondition":5,"totalWeight":32580,
//         "inventory":25, "unitPrice":13500,"currency":"CNY"
//     }],
//     "mainFileList": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]"
// }
})
}

/*
### 发布售箱:售箱公司提交发布(编辑增加id 传参)
*/
export const saleBoxSubmit = (data: any) => {
return request({
url: baseUrl+'/saleBoxSubmit',
method: 'post',
data: data
// data:{
//     "carryCityId": 1,"carryCityName": "郑州","carryCountryId": 1,"carryCountryName": "中国",
//     "payCurrency":"USD,CNY",
//     "invoiceType":"5,15,20",
//     "productionDateStart":"2024-04-17T10:44:57",
//     "productionDateEnd":"2024-06-17T10:44:57",
//     "groundingMethod":5,
//     "remark": "备注",
//     "releaseSalePriceList":[{
//         "boxType":5,"boxCondition":5,"totalWeight":32580,
//         "inventory":25, "unitPrice":13500,"currency":"CNY"
//     }],
//     "mainFileList": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]"
// }
})
}

/*
### 发布售箱:货代提交发布(编辑增加id 传参)
POST {{baseUrl}}/releaseSales/wangBuySubmit
*/
export const wangBuySubmit = (data: any) => {
return request({
url: baseUrl+'/wangBuySubmit',
method: 'post',
data: data
// data:{
//     "carryCityId": 1,"carryCityName": "郑州","carryCountryId": 1,"carryCountryName": "中国",
//     "payCurrency":"USD,CNY",
//     "invoiceType":"5,15,20",
//     "planPickupDate":"2024-04-17T10:44:57",
//     "groundingMethod":5,
//     "remark": "备注",
//     "releaseSalePriceList":[{
//         "boxType":5,"boxCondition":5,"totalWeight":32580,
//         "inventory":25, "unitPrice":13500,"currency":"CNY"
//     }],
//     "mainFileList": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]"
// }
})
}


// ### 发布售箱:买箱公司放入已下架(编辑增加id 传参)
// ## 

export const wangBuyInWarehouse = (data: any) => {
  return request({
    url: baseUrl+'/wangBuyInWarehouse',
    method: 'POST',
    data: data
  })
}

// {
//   "carryCityId": 1,"carryCityName": "郑州","carryCountryId": 1,"carryCountryName": "中国",
//   "payCurrency":"USD,CNY",
//   "invoiceType":"5,15,20",
//   "planPickupDate":"2024-04-17T10:44:57",
//   "groundingMethod":5,
//   "remark": "备注",
//   "releaseSalePriceList":[{
//       "boxType":5,"boxCondition":5,"totalWeight":32580,
//       "inventory":25, "unitPrice":13500,"currency":"CNY"
//   }],
//   "mainFileList": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]"
// }
// # 输入参数:
//   # carryCityId:提箱城市Id
//   # carryCityName:提箱城市名称
//   # carryCountryId:提箱国家Id
//   # carryCountryName:提箱国家名称
//   # payCurrency:结算币种(美元:USD 人民币:CNY 用英文逗号分割)
//   # invoiceType:发票类型 5-增值税普通发票  15-形式发票 20-其它
//   # planPickupDate:预计提箱日期
//   # groundingMethod:上架方式 5-立即上架  10-放入仓库
//   # releaseSalePriceList:售箱价格列表
//   # mainFileList:主图
//   # 以上字段必填
//   # detailFileList:简介
//   # remark:备注
// # 输出model:
//   # 1803633694563580226  主键Id
// ###


/*
### 发布售箱:批量删除
##  DELETE  {{baseUrl}}/releaseSales 
*/
export const deletePitch = (data: any) => {
return request({
url: baseUrl,
method: 'DELETE',
data: data
// data:[1,2]
})
}

/*
## 发布售箱:批量上架
##  PUT  {{baseUrl}}/releaseSales/onShelf
*/
export const publishPitch = (data: any) => {
return request({
url: baseUrl+'/onShelf',
method: 'PUT',
data: data
// data:[1803633694563580226,1803633694563580227]
})
}

/*
### 发布售箱:批量下架
##  PUT  {{baseUrl}}/releaseSales/offShelf
*/
export const downPitch = (data: any) => {
return request({
url: baseUrl+'/offShelf',
method: 'PUT',
data: data
// data:[1803633694563580226,1803633694563580227]
})
}

/*
### 发布售箱:状态统计
##  POST  {{baseUrl}}/releaseSales/statusCount
*/
export const statusCount = (data:any) => {
  return request({
    url: baseUrl+'/statusCount',
    method: 'post',
    data: data
  })
}